package org.sam.swing;

import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * 鼠标控制绘制的demo
 * @author sam
 *
 */
public class JFramePaintDemo extends JFrame {

	private static final long serialVersionUID = 7858061906996982341L;

	/**
	 * 用于绘制的控件
	 * @author sam
	 *
	 */
	private class JPaintPane extends JPanel{

		private static final long serialVersionUID = 382824106279975661L;
		
		private JPaintPane(){
			this.addKeyListener(new KeyListener() {
				
				@Override
				public void keyTyped(KeyEvent e) {
					
				}
				
				@Override
				public void keyReleased(KeyEvent e) {
					
				}
				
				@Override
				public void keyPressed(KeyEvent e) {
				}
			});
		}

		/**
		 * 重绘事件
		 */
		@Override
		public void update(Graphics g) {
			super.update(g);
		}
	}
	
	
}
